{% extends "admin/base.html" %}

{% block content %}
<div class="content-header">
    <h1>用户管理</h1>
</div>

<div class="row">
    <div class="col-md-12">
        <div class="card border-0 shadow-sm">
            <div class="card-header bg-white border-0 py-3 d-flex justify-content-between align-items-center">
                <h5 class="mb-0">用户列表</h5>
                <div class="badge bg-light text-dark">总计 {{ users|length }} 人</div>
            </div>
            <div class="card-body p-0">
                <div class="table-responsive">
                    <table class="table table-borderless mb-0">
                        <thead class="border-bottom">
                            <tr>
                                <th class="py-3 px-4">ID</th>
                                <th class="py-3 px-4">用户名</th>
                                <th class="py-3 px-4">邮箱</th>
                                <!-- 删除操作列 -->
                            </tr>
                        </thead>
                        <tbody>
                            {% for user in users %}
                            <tr class="border-bottom">
                                <td class="px-4 py-3">{{ user.id }}</td>
                                <td class="px-4 py-3">
                                    <div class="d-flex align-items-center">
                                        <div class="avatar bg-primary text-white rounded-circle d-flex align-items-center justify-content-center me-3" style="width: 36px; height: 36px; font-size: 0.9rem;">
                                            {{ user.username[0].upper() }}
                                        </div>
                                        <div class="fw-medium">{{ user.username }}</div>
                                    </div>
                                </td>
                                <td class="px-4 py-3 text-muted">{{ user.email }}</td>
                                <!-- 删除操作按钮 -->
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}